//
//  SYLoginDataMaster.m
//  MicroNews
//
//  Created by siyue on 15/10/26.
//  Copyright © 2015年 siyue. All rights reserved.
//

#import "SYLoginDataMaster.h"

#define UserInfo @"USERINFO"

@implementation SYLoginDataMaster

+ (instancetype) sharedInstance
{
    static SYLoginDataMaster *sharedInstance = nil ;
    static dispatch_once_t onceToken;  // 锁
    dispatch_once (&onceToken, ^ {     // 最多调用一次
        sharedInstance = [[self alloc] init];
    });
    return sharedInstance;
}

- (void)saveLoginDataWithDic:(NSDictionary *)dic {
    [[NSUserDefaults standardUserDefaults] setObject:dic forKey:UserInfo];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

- (NSDictionary *)getLoginData {
    NSDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:UserInfo];
    return dic;
}

@end
